package contratosonline.entity;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author admin
 */
@Entity
@Table(name = "fiscalcontrato", schema = "contratos")
@NamedQueries({@NamedQuery(name = "Fiscalcontrato.findAll", query = "SELECT f FROM FiscalContrato f"), @NamedQuery(name = "Fiscalcontrato.findByIdFiscalContrato", query = "SELECT f FROM FiscalContrato f WHERE f.idFiscalContrato = :idFiscalContrato"), @NamedQuery(name = "Fiscalcontrato.findByMatriculaSIAPE", query = "SELECT f FROM FiscalContrato f WHERE f.matriculaSIAPE = :matriculaSIAPE"), @NamedQuery(name = "Fiscalcontrato.findByNomeServidor", query = "SELECT f FROM FiscalContrato f WHERE f.nomeServidor = :nomeServidor"), @NamedQuery(name = "Fiscalcontrato.findByTelefoneResidencial", query = "SELECT f FROM FiscalContrato f WHERE f.telefoneResidencial = :telefoneResidencial"), @NamedQuery(name = "Fiscalcontrato.findByTelefoneCelular", query = "SELECT f FROM FiscalContrato f WHERE f.telefoneCelular = :telefoneCelular"), @NamedQuery(name = "Fiscalcontrato.findByEmail", query = "SELECT f FROM FiscalContrato f WHERE f.email = :email")})
public class FiscalContrato implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "idFiscalContrato")
    private Integer idFiscalContrato;
    @Basic(optional = false)
    @Column(name = "matriculaSIAPE")
    private String matriculaSIAPE;
    @Basic(optional = false)
    @Column(name = "nomeServidor")
    private String nomeServidor;
    @Column(name = "telefoneResidencial")
    private String telefoneResidencial;
    @Column(name = "telefoneCelular")
    private String telefoneCelular;
    @Column(name = "email")
    private String email;
    @JoinColumn(name = "setor", referencedColumnName = "idSetor")
    @ManyToOne(fetch = FetchType.EAGER)
    private Setor setor;
    @OneToMany(mappedBy = "fiscal", fetch = FetchType.EAGER)
    private Collection<Contrato> contratoCollection;

    public FiscalContrato() {
    }

    public FiscalContrato(Integer idFiscalContrato) {
        this.idFiscalContrato = idFiscalContrato;
    }

    public FiscalContrato(Integer idFiscalContrato, String matriculaSIAPE, String nomeServidor) {
        this.idFiscalContrato = idFiscalContrato;
        this.matriculaSIAPE = matriculaSIAPE;
        this.nomeServidor = nomeServidor;
    }

    public Integer getIdFiscalContrato() {
        return idFiscalContrato;
    }

    public void setIdFiscalContrato(Integer idFiscalContrato) {
        this.idFiscalContrato = idFiscalContrato;
    }

    public String getMatriculaSIAPE() {
        return matriculaSIAPE;
    }

    public void setMatriculaSIAPE(String matriculaSIAPE) {
        this.matriculaSIAPE = matriculaSIAPE;
    }

    public String getNomeServidor() {
        return nomeServidor;
    }

    public void setNomeServidor(String nomeServidor) {
        this.nomeServidor = nomeServidor;
    }

    public String getTelefoneResidencial() {
        return telefoneResidencial;
    }

    public void setTelefoneResidencial(String telefoneResidencial) {
        this.telefoneResidencial = telefoneResidencial;
    }

    public String getTelefoneCelular() {
        return telefoneCelular;
    }

    public void setTelefoneCelular(String telefoneCelular) {
        this.telefoneCelular = telefoneCelular;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public Setor getSetor() {
        return setor;
    }

    public void setSetor(Setor setor) {
        this.setor = setor;
    }

    public Collection<Contrato> getContratoCollection() {
        return contratoCollection;
    }

    public void setContratoCollection(Collection<Contrato> contratoCollection) {
        this.contratoCollection = contratoCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idFiscalContrato != null ? idFiscalContrato.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof FiscalContrato)) {
            return false;
        }
        FiscalContrato other = (FiscalContrato) object;
        if ((this.idFiscalContrato == null && other.idFiscalContrato != null) || (this.idFiscalContrato != null && !this.idFiscalContrato.equals(other.idFiscalContrato))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "contratosonline.entity.FiscalContrato[idFiscalContrato=" + idFiscalContrato + "]";
    }

}

